class Link < ActiveRecord::Base
    
    has_one :from_didily, :foreign_key => 'from_id', :class_name => 'Didily', :dependent => :nullify
    has_one :to_link, :foreign_key => 'to_id', :class_name => 'Didily', :dependent => :nullify
    
    validates_presence_of :uri, :message => "Uri is required"
    
    #Url_Reg_Ex = /^((http|https):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}:(([0-9]{1,5})?\/).*?$/ix
    #validates_format_of :uri, :with => Url_Reg_Ex, :message => "Please enter a valid uri."   
    
end
